// Copyright (c) 2021 Presto Labs Pte. Ltd.
// Author: leon

#pragma once

#include <iomanip>
#include <sstream>
#include <string>

#include "coin2/base/time.h"
#include "coin2/exchange/feed.pb.h"

struct IvGreeks {
  int64_t timestamp;
  double ask_iv;
  double bid_iv;
  double mark_iv;
  double delta;
  double gamma;
  double rho;
  double theta;
  double vega;

  void Clear() {
    timestamp = 0;
    ask_iv = 0;
    bid_iv = 0;
    mark_iv = 0;
    delta = 0;
    gamma = 0;
    rho = 0;
    theta = 0;
    vega = 0;
  }
};

inline std::ostream& operator<<(
    std::ostream& os,
    const IvGreeks& iv_greeks) {
  os << "Iv Greeks ";
  os << "(ask_iv=";
  os << std::setw(15);
  os << iv_greeks.ask_iv;
  os << ",bid_iv=";
  os << std::setw(15);
  os << iv_greeks.bid_iv;
  os << ",mark_iv=";
  os << std::setw(15);
  os << iv_greeks.mark_iv;
  os << ",delta=";
  os << std::setw(15);
  os << iv_greeks.delta;
  os << ",gamma=";
  os << std::setw(15);
  os << iv_greeks.gamma;
  os << ",rho=";
  os << std::setw(15);
  os << iv_greeks.rho;
  os << ",theta=";
  os << std::setw(15);
  os << iv_greeks.theta;
  os << ",vega=";
  os << std::setw(15);
  os << iv_greeks.vega;
  os << ")";
  return os;
}
